
import 'package:aone_common/common.dart';
import 'package:aone_common/entities/site/site.dart';
import 'package:get/get.dart';

class VMarqueeState {
  late GDNoticeEntity gdNotice;
  late final RxString _noticeString = ''.obs;
  get noticeString => _noticeString.value;
  set noticeString(value) => _noticeString.value = value;
}

class VMarqueeController extends GetxController {

  VMarqueeState state = VMarqueeState();

  @override
  void onInit() async {
    super.onInit();
    await getGDNoticeList();
  }

  Future<void> getGDNoticeList() async {
    var res = await SiteApi.gdNotice();
    if (res.status == Status.done) {
      state.gdNotice = res.data!;
      state.noticeString = state.gdNotice.items!.map((e) => '    ${e.body}').join();
    }
  }
}